package com.hmy.infrastructure.service.aliemas.dto;

import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;

import java.util.List;

@Data
public class AliEmasMsgInfoDto {

    /**
     * 设备id&账户id list
     * 暂时target仅为DEVICE&ACCOUNT时此参数有效
     */
    private List<String> targetBodyIds;

    /**
     * 设备idStr格式:targetId1,targetId2,targetId3
     */
    private String targetBodyIdsStr;

    /**
     * 消息头
     */
    private String messageTitle;

    /**
     * 消息内容，内容是有限制的:Title + Body <= 1800B
     */
    private String messageBody;

    public String targetBody2Str(List<String> targetBody) {
        if (CollectionUtil.isNotEmpty(targetBody)) {
            return String.join(",", targetBody);
        }
        return null;
    }


}
